<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core">

    <ui:composition template="/WEB-INF/template/crud/edit.xhtml">
        <ui:param name="MB" value="#{contaController}"/>
        <ui:param name="OPERACAO" value="Editar"/>
        <ui:define name="edit">
                <div class="control-group">
                    <h:outputLabel value="Descricao: " for="ctaDescricao" styleClass="control-label"/>
                    <div class="controls">
                        <h:inputText id="ctaDescricao" value="#{MB.selected.ctaDescricao}" title="Descrição da conta" required="true" requiredMessage="Descrição da conta é requerido"/>
                    </div>
                </div>
                <div class="control-group">
                    <h:outputLabel value="Categoria: " for="categoria" styleClass="control-label"/>
                    <div class="controls">
                    </div>

                    <div class="controls">
                        <h:selectOneMenu value="#{MB.selected.categoria}" id="categoria" required="true" requiredMessage="Selecione a categoria" >
                            <f:selectItems value="#{MB.selectCategoria}" var="categoria" itemLabel="#{categoria}" itemValue="#{categoria.idCat}"/>
                            <f:ajax render="@form"  />
                        </h:selectOneMenu>
                    </div>
                </div>

            <h:panelGroup id="contaCapital" >
                <div class="control-group">
                    <h:outputLabel value="*Data Inicial: " for="ctaDataInicial" styleClass="control-label"/>
                    <div class="controls">
                        <div class="input-append date datepicker" data-date="12-02-2012">
                            <h:inputText id="ctaDataInicial" value="#{MB.selected.ctaDataInicial}" title="Data do saldo da conta" >
                                <f:convertDateTime pattern="dd/MM/yyyy" type="date"/>
                            </h:inputText>
                            <span class="add-on"><i class="icon-calendar"></i></span>
                        </div>
                    </div>
                </div>
                <div class="control-group">
                    <h:outputLabel value="*Saldo Inicial: " for="ctaSaldoInicial" styleClass="control-label"/>
                    <div class="controls">
                        <h:inputText id="ctaSaldoInicial" value="#{MB.selected.ctaSaldoInicial}" title="Saldo inicial da conta" styleClass="moeda">
                            <f:convertNumber pattern="#,##0.00"/>
                        </h:inputText>
                    </div>
                </div>
                <h:outputLabel value="*Informar os dados apenas para contas de capital(C)" />
            </h:panelGroup>

        </ui:define>
    </ui:composition>

</html>
